<!-- 
 跳转汇付
      <宾和>
      Created by YSG on 2017-01-06.
      Copyright 2017 YSG. All rights reserved.
 -->
<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>汇付-点点生钱</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../assets/css/mui.min.css" rel="stylesheet" />
		<link href="../assets/css/main.css" rel="stylesheet" />
		<style type="text/css">

		</style>
	</head>

	<body>
		<!--header beg-->
		<header class="mui-bar mui-bar-transparent">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">第三方托管</h1>
		</header>
		<div class="mui-content">
		</div>
		<script src="../assets/lib/mui/mui.min.js"></script>
		<script src="../assets/lib/zepto/zepto.min.js"></script>
		<script src="../assets/lib/layer_mobile/layer.js"></script>
		<script src="../assets/common/util.js"></script>
		<script src="../assets/common/common.js"></script>
		<script src="../assets/js/messenger.js"></script>
		<script type="text/javascript">
			var messenger = new Messenger('parent', 'h5');
			var url = Util.requestURL('url');
			url = decodeURIComponent(url) + "&pageType=1";
			var module = Util.requestURL('module');
			var Main = function() {
				mui.init({
					swipeBack: false, //启用右滑关闭功能
					subpages: [{
						url: url, //子页面HTML地址，支持本地地址和网络地址
						id: 'huifu-1', //子页面标志
						styles: {
							top: '45px', //mui标题栏默认高度为45px；
							bottom: '0px' //默认为0px，可不定义；
						},
						extras: {} //额外扩展参数
					}],
				});
				this.init();
				this.even();
			};
			Main.prototype = {
				init: function() {
					var title;
					switch(module) {
						case 'registerAccount':
							title = "开通第三方";
							break;
						case 'recharge':
							title = "充值";
							break;
						case 'withdraw':
							title = "提现";
							break;
						case 'bank':
							title = "绑定银行卡";
							break;
						case 'loan':
							title = "立即还款";
							break;
						case 'buybidplan':
							title = "投标确认";
							break;
						case 'biding':
							title = "";
							break;
						default:
							break;
					}
					$('.mui-title').text(title);

					/*					var div = '<div class="mui-iframe-wrapper" style="top: 45px; bottom: 0px;"><iframe src="' + url + '" id="huifu-1" name="huifu-1"></iframe></div>';
										//页面层
										layer.open({
											type: 1,
											btn: ["点击关闭本页面"],
											yes: function(index) {
												layer.close(index);
											},
											content: div,
											anim: 'up',
											style: 'position:fixed; bottom:0; left:0; width: 100%; height: 100%; padding:10px 0; border:none;'
										});*/
				},
				even: function() {
					messenger.listen(function(msg) {
						mui.openWindow("huifuCallUrl.html?msg=" + msg + "&module=" + module);
					});
					/*$('#huifu-1').load(function(e) {
						var msg = document.getElementById('huifu-1').contentWindow.document;
						console.log(document.getElementById('huifu-1').contentWindow.document)
						var callUrl = msg.baseURI;
						if(callUrl) {
							//http://127.0.0.1:8000/sh_p2p_bhtz/thirdPay/pageUrlThirdPayInterface.do
							callUrl = callUrl.substring(callUrl.indexOf("?") + 1, callUrl.length);
							console.log("===" + callUrl + "====");
							var param = {}
							mui.getJSON(callUrl, param, function(retData) {
								console.log(retData);
							})
						}
					});*/
				}
			}
			$(function() {
				new Main();
			});
			function removeBackBtn(){
				$('.mui-action-back').remove();
			}
		</script>
	</body>

</html>